<!--  -->
<template>
  <div class="head">
    <el-row>
      <el-col :span="6">
      <h1>拼团商城后台管理系统</h1>
      </el-col>
      <el-col :span="6" :offset="12">
        <div class="headRight">
          <div class="user">{{user}}</div>
          <div @click="loginOut"><i class="el-icon-switch-button"></i></div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import ActionType from '../../store/ActionType'
export default {
  name:'Header',
  data(){
    return {
      user: JSON.parse(sessionStorage.getItem('userInfo')).adminName
    }
  },
  methods: {
    loginOut(){
      this.$store.dispatch(ActionType.loginOut)
      this.$router.push('/login')
    }
  }
}
</script>

<style  scoped>
  .head{
    color: white;
  }
  .el-icon-switch-button{
    font-size: 28px;
    font-weight: 700;
    line-height: 60px;
  }
  .user{
    float: left;
    margin-left: 250px;
  }
  .headRight{
    text-align: right;
  }
</style>
